package com.herench.bs.handler;

import com.herench.bs.agent.IPersonAgent;
import com.herench.bs.annotation.Handler;
import com.herench.bs.support.AbstractMessageHandler;
import com.herench.bs.support.RequestMessage;
import com.herench.bs.support.ResponseMessage;
import org.springframework.stereotype.Component;

import java.util.Map;

@Component
@Handler(code = "100604" ,name="收藏状态检测")
public class CheckEnshrineStatusHandler  extends AbstractMessageHandler {
    @Override
    protected ResponseMessage innerHandler(RequestMessage requestMessage) throws Exception {
        ResponseMessage responseMessage = new ResponseMessage(requestMessage.getId());
        String userId = requestMessage.getArgsPropertyStringValue("user");
        String collectContent = requestMessage.getArgsPropertyStringValue("docId");
        String collectType = requestMessage.getArgsPropertyStringValue("collectType");
        IPersonAgent agent = getCleverClinicContext().getApplicationContext().getBean(IPersonAgent.class);
        Map<String, Object> res = agent.checkEnshrineStatus(userId,collectContent,collectType);
        responseMessage.setData(res);
        getPropertiesFromInvokerResultMap(responseMessage, res);
        return responseMessage;
    }
}
